#include "memstack.h"

#include "globals.h"

VOID push(MEMORY* mem) {
	mem->next = mem_head;
	mem_head = mem;
	avail_mem++;
}

MEMORY* pop_memory() {
	if(mem_head != NULL) {
		MEMORY* mem = mem_head;
		mem_head = mem_head->next;
		avail_mem--;
		return mem;
	}
	return NULL;
}
